<template>
  <MoveModal
    width="60%"
    title="个人信息"
    :visible="modalShow"
    @ok="modalShow = false"
    @cancel="modalShow = false"
    :footer="null">
    <a-spin :spinning="spinning">
      <div style="display: flex;flex-direction: row;align-items: flex-start;">
        <div class="flex-item-3" style="width: 70%">
          <a-descriptions bordered :column="2">
            <a-descriptions-item label="编号">
              {{ person.id }}
            </a-descriptions-item>
            <a-descriptions-item label="姓名">
              {{ person.name }}
            </a-descriptions-item>
            <a-descriptions-item label="性别">
              {{ person.gender_text }}
            </a-descriptions-item>
            <a-descriptions-item label="民族">
              {{ person.nation_text }}
            </a-descriptions-item>
            <a-descriptions-item label="身份证号">
              {{ person.cardno }}
            </a-descriptions-item>
            <a-descriptions-item label="出生日期">
              {{ person.birthym }}
            </a-descriptions-item>
            <a-descriptions-item label="文化程度">
              {{ person.culture_text }}
            </a-descriptions-item>
            <a-descriptions-item label="原政治面貌">
              {{ person.politics_text }}
            </a-descriptions-item>
            <a-descriptions-item label="原职业">
              {{ person.oricareer }}
            </a-descriptions-item>
            <a-descriptions-item label="就业就读情况">
              {{ person.perform_text }}
            </a-descriptions-item>
            <a-descriptions-item label="婚姻状况">
              {{ person.marriage_text }}
            </a-descriptions-item>
            <a-descriptions-item label="手机号">
              {{ person.phone }}
            </a-descriptions-item>
            <a-descriptions-item label="矫正类别">
              {{ person.crctype_text }}
            </a-descriptions-item>
            <a-descriptions-item label="管控类别">
              {{ person.controltype_text }}
            </a-descriptions-item>
            <a-descriptions-item label="所在司法所">
              {{ person.deptname }}
            </a-descriptions-item>
            <a-descriptions-item label="原判起止日">
              {{ person.oristartdate }} - {{ person.orienddata }}
            </a-descriptions-item>
            <a-descriptions-item label="矫正期限">
              {{ person.timelong }}
            </a-descriptions-item>
            <a-descriptions-item label="矫正起止日">
              {{ person.startdate }} - {{ person.enddate }}
            </a-descriptions-item>
          </a-descriptions>
        </div>
        <div class="flex-item-1">
          <img :src="person.avatarUrl" alt="" style="margin: 0px 16px;width: 250px;height: 350px;" />
        </div>
      </div>
    </a-spin>

  </MoveModal>
</template>

<script>
import { viewPerson } from '@/api/correction/crc_person.js'
import { Decrypt } from '@/enumeration/SM.js'
import Item from '@/components/AvatarList/Item'
export default {
  data () {
    return {
      spinning: false,
      modalShow: false,
      person: {} // 人员信息
    }
  },
  created () {
  },
  components: {
    MoveModal: () => import('@/components/Power/MoveModal.vue')
  },
  methods: {
    async init (personId) {
      this.modalShow = false
      if (!personId) {
        this.$message.error('当前人员的id为空')
      } else {
        const res = await viewPerson(personId)
        if (res.code == 0) {
          this.person = res.data
            this.person.name = Decrypt(this.person.name)
            this.person.cardno = Decrypt(this.person.cardno)
            this.person.phone = Decrypt(this.person.phone)
          this.modalShow = true
        } else {
          this.$message.error('查询人员数据为空')
        }
      }
    }
  }
}
</script>

<style>

</style>
